<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
<title>数组求和、求最大值</title>
  <script>
   var arr = [10, 20, 30, 40, 50]; // 原始数组
   //求和
   var sum = 0;
   for(var i=0; i<arr.length; i++){
    sum = sum + arr[i];
   }
   console.log("sum = " + sum);
   //求最大值
   var max = Number.MIN_VALUE;
   for(var i=0; i<arr.length; i++){
    if(arr[i] > max){
     max = arr[i];
    }
   }
   console.log("max = " + max);
  </script>
 </head>
 <body>
  <h1>数组求和、求最大值</h1>
 </body>
</html>
